package de.thw.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import de.thw.web.factory.MainFactory;
import de.thw.web.factory.PageFactory;
import de.thw.web.object.Page;
import de.thw.web.service.UserService;
import de.thw.web.service.WebsiteService;

@Controller
@RequestMapping("/")
public class MainController extends AbstractController {

	@Autowired
	protected WebsiteService serviceWebsite;

	@Autowired
	protected UserService serviceUser;

	// /////////////////////////////////////////////////////////////////////////////
	
	@RequestMapping({ "", "home" })
	public ModelAndView home(HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		Page page = PageFactory.getCurrentPage();

		ModelAndView modelView = MainFactory.getModelAndView(page);

		return modelView;
	};

};